home *** CD-ROM | disk | FTP | other *** search
- /*
- file: CP_EXT.h
-
- header file for copypaste externals
-
- History:
- Version 1.0 10/9/1997
- */
-
-
- #ifndef _CP_EXTERNALS_
- #define _CP_EXTERNALS_ 1
-
-
- #include <windows.h>
-
-
- //
- // this section describe how to call back to CopyPaste
- // from your external.
- //
-
- // Parameter block to pass to the CopyPaste entry point.
- // the contents of this struct depends on the
- // CPEntrypointOptions described below
-
- typedef struct CPParamBlock
- {
- SHORT wparam1;
- SHORT wparam2;
- LONG lparam1;
- LONG lparam2;
- HANDLE handle1;
- HANDLE handle2;
- }
- CPParamBlock, *pCPParamBlock;
-
-
- // here comes the valid options to call back to CopyPaste
- // <- indicate that these values must be initialized on entry
- // -> filled with result on exit
-
- enum CPEntrypointOptions
- {
- /* wparam1 -> number of clipboard ( 0..9 )
- */
- eGetCurrentClipboard = 1,
-
- /* wparam1 -> number of entrys in handle1 ( const 10 )
- handle1 -> list of UINTs containing number of formats
- for each clipboard || 0 for empty clipboard
- allocated with GlobalAlloc(
- GMEM_MOVEABLE|GMEM_DDE_SHARE).
- caller is responsible to GlobalFree()
- */
- eGetClipboardList,
-
- /* wparam1 <- number of clipboard ( 0..9 )
- wparam2 -> number of formats || 0
- handle1 -> list of UINTs containing formats
- allocated with GlobalAlloc(
- GMEM_MOVEABLE|GMEM_DDE_SHARE).
- caller is responsible to GlobalFree()
- NULL if formats == 0
- */
- eGetClipboardFormatList,
-
- /* wparam1 <- number of clipboard ( 0..9 )
- wparam2 <- clipboard format CF_TEXT, CF_DIB...
- handle1 -> copy of clipboard data handle || NULL
- allocated with GlobalAlloc(
- GMEM_MOVEABLE|GMEM_DDE_SHARE).
- caller is responsible to GlobalFree()
- */
- eGetClipboardItem,
-
- /* wparam1 <- number of clipboard ( 0..9 )
- wparam2 <- clipboard format CF_TEXT, CF_DIB...
- handle1 <- handle of data, returned from GetClipboardItem
- || allocated with GlobalAlloc(
- GMEM_MOVEABLE|GMEM_DDE_SHARE).
- */
- eSetClipboardItem = 10
-
- };
-
-
- // next are possible errors returned from Callback to CopyPaste
- // if errors is not listed here, its a value from GetLastError()
-
- enum CPErrors
- {
- errNoError,
- errClipboardIsEmpty = -1000,
- errFormatNotAvailable = -1001,
- errNoCurrentClipboard = -1002,
- errEmptyDataHandle = -1003
- };
-
-
- // here is how to call to CopyPaste
-
- typedef LRESULT (CALLBACK *CPEntryProcPtr)(CPEntrypointOptions option,
- CPParamBlock *param );
-
-
- // this macro makes it easy to call back to CopyPaste
- // entryPoint is the second argument from "ENTRYPOINT"
-
- #define CallCP(x,y) (*entryPoint)(x,y)
-
-
-
- // this are the options passed to ENTRYPOINT as first argument
- enum CPExternalOptions
- {
- eInitExternal = -2, // called once at startup
- eDeinitExternal = -1, // called once on exit
- eFirstOption = 1 // your first custom menu call
-
- /* define options as you like */
- };
-
-
- //
- // this section describe how CopyPaste calls your externals
- //
-
- // this define names the entrypoint used by GetProcAddress()
- #define kENTRYPOINTNAME "CP_ENTRYPOINT"
-
-
- // CopyPaste entry point to the externals
-
- typedef LRESULT (CALLBACK *ENTRYPOINTFP)(SHORT option,
- CPEntryProcPtr entryPoint, LPARAM *lparam, HANDLE *globals);
-
-
- // prototype for our external main entry point
-
- LRESULT CALLBACK CP_ENTRYPOINT(SHORT option, CPEntryProcPtr entryPoint,
- LPARAM *lparam, HANDLE *globals);
-
-
-
- #endif // _CP_EXTERNALS_
-